package com.bjsxt.shop.users.pojo;

import java.io.Serializable;
import java.util.Date;

/**
 * 管理员表的POJO
 * 
 * @author WangshSxt
 */
public class AAdmins implements Serializable
{
	private int id;
	private int ssoId;
	private String email;
	private String trueName;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date lastLoginTime;

	/* 关联对象 */
	private ARole role;

	/* 字符串描述 */
	private String statusStr;

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	/**
	 * 状态:0:禁用,1:启用
	 * 
	 * 根据status的值显示对应的字符串(从枚举中取值)
	 * 
	 * @return
	 */
	public String getStatusStr()
	{
		/*
		 * 循环枚举
		 */
		AAdminsEnum[] adminsEnums = AAdminsEnum.values();
		for (int i = 0; i < adminsEnums.length; i++)
		{
			AAdminsEnum adminsEnum = adminsEnums[i];
			/*
			 * 一个表中有多个byte类型的字段(枚举) 不同的byte字段可以有相同的值, 所以在判断的时候,即要判断值,又要判断名称
			 */
			if (this.getStatus() == adminsEnum.getStatus() && adminsEnum.toString().startsWith("STATUS"))
			{
				this.statusStr = adminsEnum.getInfo();
			}
			/*
			 * ConstatFinalUtil.SYS_LOGGER.info("info:{},status:{},属性名:{}",
			 * adminsEnum.getInfo(),adminsEnum.getStatus(),adminsEnum);
			 */
		}
		return statusStr;
	}

	public int getSsoId()
	{
		return ssoId;
	}

	public void setSsoId(int ssoId)
	{
		this.ssoId = ssoId;
	}

	public String getEmail()
	{
		return email;
	}

	public void setEmail(String email)
	{
		this.email = email;
	}

	public String getTrueName()
	{
		return trueName;
	}

	public void setTrueName(String trueName)
	{
		this.trueName = trueName;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Date getLastLoginTime()
	{
		return lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime)
	{
		this.lastLoginTime = lastLoginTime;
	}

	public ARole getRole()
	{
		return role;
	}

	public void setRole(ARole role)
	{
		this.role = role;
	}
}
